package com.ruoyi.patrol.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.patrol.mapper.PtCompanyMapper;
import com.ruoyi.patrol.domain.PtCompany;
import com.ruoyi.patrol.service.IPtCompanyService;

/**
 * 公司Service业务层处理
 *
 * @author linan
 * @date 2024-02-02
 */
@Service
public class PtCompanyServiceImpl implements IPtCompanyService
{
    @Autowired
    private PtCompanyMapper ptCompanyMapper;

    /**
     * 查询公司
     *
     * @param id 公司主键
     * @return 公司
     */
    @Override
    public PtCompany selectPtCompanyById(Long id)
    {
        return ptCompanyMapper.selectPtCompanyById(id);
    }

    /**
     * 查询公司列表
     *
     * @param ptCompany 公司
     * @return 公司
     */
    @Override
    public List<PtCompany> selectPtCompanyList(PtCompany ptCompany)
    {
        return ptCompanyMapper.selectPtCompanyList(ptCompany);
    }

    /**
     * 新增公司
     *
     * @param ptCompany 公司
     * @return 结果
     */
    @Override
    public int insertPtCompany(PtCompany ptCompany)
    {
        ptCompany.setCreateTime(DateUtils.getNowDate());
        return ptCompanyMapper.insertPtCompany(ptCompany);
    }

    /**
     * 修改公司
     *
     * @param ptCompany 公司
     * @return 结果
     */
    @Override
    public int updatePtCompany(PtCompany ptCompany)
    {
        ptCompany.setUpdateTime(DateUtils.getNowDate());
        return ptCompanyMapper.updatePtCompany(ptCompany);
    }

    /**
     * 批量删除公司
     *
     * @param ids 需要删除的公司主键
     * @return 结果
     */
    @Override
    public int deletePtCompanyByIds(Long[] ids)
    {
        return ptCompanyMapper.deletePtCompanyByIds(ids);
    }

    /**
     * 删除公司信息
     *
     * @param id 公司主键
     * @return 结果
     */
    @Override
    public int deletePtCompanyById(Long id)
    {
        return ptCompanyMapper.deletePtCompanyById(id);
    }
}
